import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
  plugins: [vue()],
  server: {
    port: 5173,
    proxy: {
      '/flowable-rest': {
        target: process.env.VITE_FLOWABLE_BASE || 'https://mx.119xfq.cn/flowable-rest',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/flowable-rest/, '')
      },
      '/api': {
        target: process.env.VITE_BACKEND_BASE || 'http://localhost:8000',
        changeOrigin: true
      }
    }
  }
});
